﻿using System;
using Communication.Message;

namespace Communication.Channel
{
	// Token: 0x02000008 RID: 8
	public interface Channel
	{
		// Token: 0x06000044 RID: 68
		void Close();

		// Token: 0x06000045 RID: 69
		void Connect(Address remoteAddress);

		// Token: 0x06000046 RID: 70
		void Disconnect();

		// Token: 0x06000047 RID: 71
		ChannelConfig GetConfig();

		// Token: 0x06000048 RID: 72
		bool IsConnected();

		// Token: 0x06000049 RID: 73
		bool IsOpen();

		// Token: 0x0600004A RID: 74
		bool IsClosed();

		/// <summary>
		/// 设置报文
		/// </summary>
		/// <param name="message"></param>
		void WriteAsync(ChannelMessage message);

		// Token: 0x0600004C RID: 76
		void WriteSync(ChannelMessage message);

		// Token: 0x0600004D RID: 77
		void AddChannelConnectedEventHandler(ChannelConnectedEventHandler handler);

		// Token: 0x0600004E RID: 78
		void RemoveChannelConnectedEventHandler(ChannelConnectedEventHandler handler);

		// Token: 0x0600004F RID: 79
		void AddChannelClosedEventHandler(ChannelClosedEventHandler handler);

		// Token: 0x06000050 RID: 80
		void RemoveChannelClosedEventHandler(ChannelClosedEventHandler handler);

		// Token: 0x06000051 RID: 81
		void AddChannelErrorEventHandler(ChannelErrorEventHandler handler);

		// Token: 0x06000052 RID: 82
		void RemoveChannelErrorEventHandler(ChannelErrorEventHandler handler);
	}
}
